package com.boot.config.datasource

/**
 * @author kawins
 * createTime 2018-12-07 16:03
 */
object DatabaseContextHolder {

    private val contextHolder = ThreadLocal<DataName>()

    var databaseType: DataName
        get() = if (contextHolder.get() == null) DataName.MYSQL else contextHolder.get()
        set(type) = contextHolder.set(type)

    fun default() {
        contextHolder.set(DataName.MYSQL)
    }

}